package s03;

import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * @ClassName BSServer
 * @Description TODO
 * @Author Li
 * @Date 2022/9/9 1:31
 * @ModifyDate 2022/9/9 1:31
 * @Version 1.0
 */
public class BSServerTest {
    public static void main(String[] args) throws IOException {
        ServerSocket server = new ServerSocket(8888);
        Socket socket = server.accept();
        InputStream is = socket.getInputStream();
        byte[] bytes = new byte[1024];
        int len = is.read(bytes);
        System.out.println(new String(bytes));
        socket.close();
        server.close();
    }
}
